package cn.cdeden.knowledge.service;


import cn.cdeden.common.core.utils.page.TableDataInfo;
import cn.cdeden.knowledge.domain.dto.TeamToEnterprise;
import cn.cdeden.knowledge.domain.dto.TeamToEnterpriseDto;
import cn.cdeden.knowledge.domain.dto.TeamToEnterpriseQueryParam;
import cn.cdeden.resource.api.domain.RemoteFile;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.data.domain.Pageable;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Set;

/**
* @author GW
* @date 2023-04-12
*/
public interface TeamToEnterpriseService extends IService<TeamToEnterprise> {

    static final String CACHE_KEY = "teamToEnterprise";

    /**
    * 查询数据分页
    * @param query 条件
    * @param pageable 分页参数
    * @return PageInfo<TeamToEnterpriseDto>
    */
    TableDataInfo<TeamToEnterpriseDto> queryAll(TeamToEnterpriseQueryParam query, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param query 条件参数
    * @return List<TeamToEnterpriseDto>
    */
    List<TeamToEnterpriseDto> queryAll(TeamToEnterpriseQueryParam query);

    TeamToEnterprise getById(Long id);
    TeamToEnterpriseDto findById(Long id);

    /**
     * 插入一条新数据。
     */
    boolean insert(TeamToEnterpriseDto resources);

    @Transactional(rollbackFor = Exception.class)
    TeamToEnterpriseDto insertFolder(TeamToEnterpriseDto resources);

    boolean updateById(TeamToEnterpriseDto resources);
    boolean deleteById(Long id);
    boolean deleteByIds(Set<Long> ids);

    TeamToEnterpriseDto selectTempTree(String tempTreeId);

    @Transactional(rollbackFor = Exception.class)
    TeamToEnterpriseDto createFolderFilePath(String parentId, String path);


    TeamToEnterpriseDto createByStorage(String formId, String parentId, RemoteFile remoteFile);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    // void download(List<TeamToEnterpriseDto> all, HttpServletResponse response) throws IOException;
}
